package com.xuecheng.swagger.web;

import com.xuecheng.swagger.pojo.Student;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * swagger api接口
 *      参数一：当前接口文档标题 参数二：当前文档描述
 */

@Api(tags = "Hello Api 服务测试", description = "对 Hello Api 服务提供的接口")
public interface HelloControllerApi {

    //当前接口的中文描述
    @ApiOperation("测试 Hello 方法")
    String hello();

    //当前接口的中文描述
    @ApiOperation("QuerySting 的测试方法")
    //                                                   只读         数据类新              参数类型
    @ApiImplicitParam(name = "num", value = "学员编号", readOnly = true, dataType = "String", paramType = "query")
    Student modifyStudentNum(@RequestParam("num") String num);



    //当前接口的中文描述
    @ApiOperation("Restful风格 的测试方法")
    //                                                   只读         数据类新              参数类型
    @ApiImplicitParam(name = "num", value = "学员名称", readOnly = true, dataType = "String", paramType = "path")
    Student modifyStudentName(@PathVariable("name") String name);


    //当前接口的中文描述
    @ApiOperation("json格式的传入参数 的测试方法")
    //                                                   只读         数据类新              参数类型
    @ApiImplicitParam(name = "num", value = "学员编号", readOnly = true, dataType = "String", paramType = "post")
    Student modifyStudent(@RequestBody Student student);

    //当前接口的中文描述
    @ApiOperation("综合参数的测试方法")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id",value = "学员编号",readOnly = true, dataType = "String", paramType = "path"),
            @ApiImplicitParam(name = "name",value = "学员名称",readOnly = true, dataType = "String", paramType = "query")
    })
    Student mofidyStudentBynNum(@PathVariable("id") String id, @RequestParam("name") String name, @RequestBody Student student);
}
